package xmlcollabserver;

import java.net.ServerSocket;
import java.net.Socket;
import java.util.List;

/**
 *
 * @author Sasa
 */
public class XMLCollabServer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        
        /* DB */
        DataBase db = new DataBase();
        
        ServerSocket server = new ServerSocket(9876);
        System.out.println("Server is up and running at port: "+ server.getLocalPort());
        System.out.println(server.getInetAddress());
        // Waiting for requests
        while(true) {
            Socket client = server.accept();
            System.out.println("Connected with: "+ client.getInetAddress());
            Requests r = new Requests(client, db);
            Thread t = new Thread(r);
            t.start();
            // komentar
        }
    }
}
